package cn.com.yitong.domain;

import cn.com.yitong.enums.SexEnum;
import cn.com.yitong.handler.WalletListTypeHandler;
import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import lombok.Data;

/**
 * 
 * @TableName user
 */
@TableName(value ="user",autoResultMap = true)
@Data
public class User implements Serializable {
    /**
     * 主键ID
     */
    @TableId
    private Long id;

    /**
     * 姓名
     */
    private String name;

    /**
     * 年龄
     */
    private Integer age;

    /**
     * 邮箱
     */
    private String email;

    @TableLogic
    private Integer deleted;

    private SexEnum sex;


    @TableField(exist = false)
    private static final long serialVersionUID = 1L;


    /**
     * 注意！！ 必须开启映射注解
     *
     * @TableName(autoResultMap = true)
     * <p>
     * 以下两种类型处理器，二选一 也可以同时存在
     * <p>
     * 注意！！选择对应的 JSON 处理器也必须存在对应依赖包
     */
    @TableField(typeHandler = WalletListTypeHandler.class)
    private List<Wallet> wallets;

    @TableField(typeHandler = FastjsonTypeHandler.class)
    private OtherInfo otherInfo;

    @TableField(value = "create_time",fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(value = "update_time",fill = FieldFill.UPDATE)
    private Date updateTime;


    @Version
    @TableField(value = "version", fill = FieldFill.INSERT)
    private Integer version;

    private Long tenantId;
}